/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package summerprojectFX.view;

/**
 *
 * @author Milan
 */
import java.awt.*;
import javax.swing.*;

public class SplashScreen extends JWindow{


    public SplashScreen()
    {
        super();
        JLabel l = new JLabel(new ImageIcon("lib/splash.jpeg"));
        getContentPane().add(l, BorderLayout.CENTER);
        pack();
        Dimension screenSize =
          Toolkit.getDefaultToolkit().getScreenSize();
        Dimension labelSize = l.getPreferredSize();
        setLocation(screenSize.width/2 - (labelSize.width/2),
                    screenSize.height/2 - (labelSize.height/2));
        setVisible(true);
        screenSize = null;
        labelSize = null;
          Runnable waitRunner = new Runnable()
            {
                public void run()
                {
                    try
                        {
                            Thread.sleep(3000);
                            
                        }
                    catch(Exception e)
                        {
                            e.printStackTrace();
                            // can catch InvocationTargetException
                            // can catch InterruptedException
                        }
                }
            };
          waitRunner.run();
          dispose();
          
    }
}

